home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / SHARE / prog / POVRAY / NOT_PC_3.ZIP / NOT_PC_3.POV
Encoding:
Text File  |  1996-04-24  |  6.7 KB  |  198 lines

  1.  
  2. //------------------------------------------------------------------->
  3. // Not_pc_3.Pov (Not Piece Three).
  4. //
  5. // Free demonstration file by: Paul T. Dawson.
  6. //                             ptdawson@voicenet.com
  7. //
  8. // For the magnificent raytracer, POV-Ray 3.0 (Thank You, POV-Team!).
  9. //
  10. // My quasi-clone of "piece3" from the POV-Ray sample files.
  11. //
  12. // I used the new loop functions to minimize the code!
  13.  
  14. //------------------------------------------------------------------->
  15. // Standard settings and include files.
  16.  
  17.         #version 3.0
  18.         global_settings { assumed_gamma 2.2 }
  19.  
  20.         #include "colors.inc"
  21.         #include "textures.inc"
  22.         #include "golds.inc"
  23.         #include "glass.inc"
  24.         #include "skies.inc"
  25.  
  26.         #default { finish { Shiny } }
  27.  
  28. //------------------------------------------------------------------->
  29. // The camera.
  30.  
  31.         camera { location < 0, 75, -45> look_at < 0, 0, -2 > }
  32.  
  33. //------------------------------------------------------------------->
  34. // Put in some lights - nothing fancy!
  35.  
  36.         light_source { <-99, 99, -99> color White}
  37.         light_source { < 99, 99, -99> color White}
  38.  
  39. //------------------------------------------------------------------->
  40. // Change these variables -carefully- to adjust the "Big_Curly" thing.
  41. // Original values are 720 (objects) and 10 (loops).
  42.  
  43.         #declare Number_Of_Objects = 720
  44.  
  45.         #declare Little_Loops = 10
  46.  
  47. // These sizes work exactly like the sizes of a POV-Ray torus.
  48.  
  49.         #declare Minor_Radius = 10
  50.         #declare Major_Radius = 30
  51.  
  52. //------------------------------------------------------------------->
  53. // Do NOT touch these. I REPEAT, DO NOT TOUCH THESE!!!
  54. // All of these values are calculated from the ABOVE settings.
  55.  
  56. // This is calculated from the two values entered above. For example,
  57. // if you have 720 objects and 10 loops, then you get 72 per loop!
  58.  
  59.         #declare Objects_Per_Little_Loop = Number_Of_Objects / Little_Loops
  60.  
  61. // This is calculated from the Number_Of_Objects entered above. Each of
  62. // the objects is rotated around the y axis, and this setting makes sure
  63. // that you end up where you started. For example, with 720 objects, each
  64. // one is 0.5 degrees ahead of the previous one.
  65.  
  66.         #declare Y_Increment = 360 / Number_Of_Objects
  67.  
  68. // BEFORE the objects spin around the y axis, they have to spin around
  69. // the z axis. This is how the curly shape is formed. With the example
  70. // settings of 720 objects and 10 loops, this value equals 5.
  71.  
  72.         #declare Z_Increment = 360 / Objects_Per_Little_Loop
  73.  
  74. //------------------------------------------------------------------->
  75. // Create the big curly thing. This one uses spheres, but you can try
  76. // just about anything (boxes, cones, cylinders, anything else).
  77.  
  78.         #declare Big_Curly = union {
  79.  
  80.         #declare Y_Rotate = 0
  81.         #declare Z_Rotate = 0
  82.  
  83.         #declare A = 1
  84.         #while ( A <= Number_Of_Objects )
  85.  
  86.         sphere { < Minor_Radius, 0, 0 >, 1.5 texture { T_Gold_5E }
  87.  
  88.                 // Rotate in a circle around <0,0,0>.
  89.                         rotate z * ( -1 * Z_Rotate )
  90.  
  91.                 // Now it's somewhere in the xy plane.
  92.                 // Move it over to the right.
  93.                         translate x * Major_Radius
  94.  
  95.                 // Spin it around the y axis.
  96.                         rotate y * Y_Rotate
  97.  
  98.                 // Just keep increasing these two.
  99.                         #declare Y_Rotate = Y_Rotate + Y_Increment
  100.                         #declare Z_Rotate = Z_Rotate + Z_Increment
  101.  
  102.                 } // End of sphere.
  103.  
  104.         #declare A = A + 1
  105.         #end
  106.  
  107.         } // End of union.
  108.  
  109. //------------------------------------------------------------------->
  110. // Now make the connector that goes inside the curly. It's just a torus,
  111. // with ten spheres attached to it. I used "merge" to put this together,
  112. // because that eliminates interior surfaces. If you change "merge" to
  113. // "union", then you can see the torus "inside" the glass spheres.
  114.  
  115.         #declare Connector_Thing = merge {
  116.  
  117.                 torus { 30, 1 texture { T_Gold_1A } }
  118.  
  119.                 #declare A = 0
  120.                 #while ( A <= 9 )
  121.  
  122.                         sphere { < 30, 0, 0 >, 6
  123.                                 rotate y * ( A * 36 )
  124.                                 texture { T_Ruby_Glass }
  125.                                 } // End of sphere.
  126.  
  127.                 #declare A = A + 1
  128.                 #end
  129.  
  130.         } // End of merge.
  131.  
  132. //------------------------------------------------------------------->
  133. // Make the big mirror sphere in the middle.
  134.  
  135.         #declare Big_Sphere = sphere { < 0, 0, 0 >, 16
  136.                 pigment { White }
  137.                 finish { Mirror }
  138.                 } // End of sphere.
  139.  
  140. //------------------------------------------------------------------->
  141. // Make the floor, with some green and yellow tiles. The tiles go past
  142. // the edges of the picture a little (on purpose!).
  143.  
  144.         // This is used to switch the tile color.
  145.         #declare FlipFlop = 0
  146.  
  147.         #declare The_Floor = union {
  148.  
  149.                 #declare X = -100 #while ( X <= 100 )
  150.                 #declare Z = -100 #while ( Z <= 100 )
  151.  
  152.                         #declare FlipFlop = 1 - FlipFlop
  153.  
  154.                         // This is a "rounded-corner-cube".
  155.  
  156.                         superellipsoid { < 0.2, 0.2 >
  157.  
  158.                                 scale < 4.8, 0.5, 4.8 >
  159.                                 translate < X, 0, Z >
  160.  
  161.                                 #if ( FlipFlop = 0 )
  162.                                         pigment { Yellow } #end
  163.                                 #if ( FlipFlop = 1 )
  164.                                         pigment { LimeGreen } #end
  165.  
  166.                                 normal { crackle 0.3 scale 0.3 }
  167.  
  168.                                 } // End of superellipsoid.
  169.  
  170.                 #declare Z = Z + 10 #end
  171.                 #declare X = X + 10 #end
  172.  
  173.                 // The "grout around the tiles".
  174.  
  175.                 box { < -150, -1, -150 > < 150, 0, 150 >
  176.                         pigment { Gray50 }
  177.                         normal { bumps 1 scale 0.1 } }
  178.  
  179.                 } // End of union.
  180.  
  181. //------------------------------------------------------------------->
  182. // Well, it's finally time to go ahead and show everything.
  183. // The sky sphere is mostly invisible, except in the mirror sphere!
  184.  
  185.         sky_sphere { S_Cloud1 }
  186.  
  187.         object { Big_Curly translate < 0, 10, 0 > }
  188.  
  189.         object { Connector_Thing translate < 0, 10, 0 > }
  190.  
  191.         object { Big_Sphere translate < 0, 10, 0 > }
  192.  
  193.         object { The_Floor translate < 0, -10, 0 > }
  194.  
  195. //------------------------------------------------------------------->
  196. // End of this file.
  197.  
  198.